package config;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;

public class CustomConfig {
	
	
	private static Properties props = new Properties();
	private static CustomConfig cc;
	
	private CustomConfig(){
		
		try{
			InputStream is =  new FileInputStream("configuration.properties");
			props.load(is);
		} catch (Exception e1) {
            System.err.println("El fichero de propiedades no se ha encontrado");
            e1.printStackTrace();
		}
		
	}
	
	public static String getConfig(String key){
		if (cc == null){
			cc = new CustomConfig();
		}
		
		return props.getProperty(key);
		
		
	}
	

}
